<div id='SeoRanks'>
    <script type="text/javascript" src="plugins/SEO/javascripts/rank.js"></script>

    <form method="post" style="padding: 8px;">
        <div align="left" class="mediumtext">
            {{ 'Installation_SetupWebSiteURL'|translate|capitalize }}
            <input type="text" id="seoUrl" size="15" value="{{ urlToRank }}" class="textbox"/>
		  <span style="padding-left:2px;">
		  <input type="submit" id="rankbutton" value="{{ 'SEO_Rank'|translate }}"/>
		  </span>
        </div>

        {% import "ajaxMacros.twig" as ajax %}
        {{ ajax.LoadingDiv('ajaxLoadingSEO') }}

        <div id="rankStats" align="left" style="margin-top:10px;">
            {% if ranks is empty %}
                {{ 'General_Error'|translate }}
            {% else %}
                {% set cleanUrl %}
                    <a href="http://{{ urlToRank }}" rel="noreferrer"  target="_blank">{{ urlToRank }}</a>
                {% endset %}
                {{ 'SEO_SEORankingsFor'|translate(cleanUrl)|raw }}
                <table cellspacing="2" style="margin:auto;line-height:1.5em;padding-top:10px;">
                    {% for rank in ranks %}
                        <tr>
{% set seoLink %}{% if rank.logo_link is defined %}<a class="linkContent" href="?module=Proxy&action=redirect&url={{ rank.logo_link|url_encode }}"
                                                    target="_blank"
                         {% if rank.logo_tooltip is not empty %}title="{{ rank.logo_tooltip }}"{% endif %}>{% endif %}{% endset %}
                            {% set majesticLink %}{{ seoLink }}Majestic</a>{% endset %}
                            <td>{% if rank.logo_link is defined %}{{ seoLink|raw }}{% endif %}<img
                                            style='vertical-align:middle;margin-right:6px;' src='{{ rank.logo }}' border='0'
                                            alt="{{ rank.label }}">{% if rank.logo_link is defined %}</a>{% endif %} {{ rank.label|replace({"Majestic":
                                majesticLink})|raw }}
                            </td>
                            <td>
                                <div style="margin-left:15px;">
                                {% if rank.logo_link is defined %}{{ seoLink|raw }}{% endif %}
                                    {% if rank.rank %}{{ rank.rank|raw }}{% else %}-{% endif %}
                                    {% if rank.id=='pagerank' %} /10
                                    {% elseif rank.id=='google-index' or rank.id=='bing-index' %} {{ 'General_Pages'|translate }}
                                    {% endif %}
                                {% if rank.logo_link is defined %}</a>{% endif %}
                                </div>
                            </td>
                        </tr>
                    {% endfor %}

                </table>
            {% endif %}
        </div>
    </form>
</div>
